package com.feedback.ui;

import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import com.feedback.a.b;
import com.feedback.c.b;
import com.feedback.c.c;
import com.feedback.c.d;
import com.mobclick.android.UmengConstants;
import com.mobclick.android.j;
import java.util.concurrent.ExecutorService;

class f
  implements View.OnClickListener
{
  public void onClick(View paramView)
  {
    int i;
    int j;
    String str = null;
    if (SendFeedback.a(this.a) != null)
      str = SendFeedback.a(this.a).getText().toString();
    if (c.a(str))
      Toast.makeText(this.a, this.a.getString(j.a(this.a, "string", "UMEmptyFbNotAllowed")), 0).show();
    while (true)
    {
      return;
      if (str.length() <= 140)
        break;
      Toast.makeText(this.a, this.a.getString(j.a(this.a, "string", "UMContentTooLong")), 0).show();
    }
    if (SendFeedback.b(this.a) != null)
    {
      i = SendFeedback.b(this.a).getSelectedItemPosition();
      if (SendFeedback.c(this.a) != null)
      {
        j = SendFeedback.c(this.a).getSelectedItemPosition();
        SharedPreferences.Editor localEditor = this.a.getSharedPreferences("UmengFb_Nums", 0).edit();
        localEditor.putInt("ageGroup", i);
        localEditor.putInt("sex", j);
        localEditor.commit();
      }
    }
    try
    {
      SendFeedback.a(this.a, d.a(this.a, str, i, j));
      b.c(this.a, SendFeedback.d(this.a));
      b localb = new b(SendFeedback.d(this.a), this.a);
      SendFeedback.executorService.submit(localb);
      Intent localIntent = new Intent(this.a, FeedbackConversations.class).setFlags(131072);
      this.a.startActivity(localIntent);
      ((InputMethodManager)this.a.getSystemService("input_method")).hideSoftInputFromWindow(SendFeedback.a(this.a).getWindowToken(), 0);
      this.a.finish();
    }
    catch (Exception localException)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            if (UmengConstants.testMode)
              localException.printStackTrace();
            b.d(this.a, SendFeedback.d(this.a));
          }
          j = -1;
        }
        i = -1;
      }
    }
  }
}